package org.agile2soft.nexoma.core.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "entry_reg_numbers")
@SuppressWarnings({"serial"})
public class EntryRegNumbers implements java.io.Serializable {

    private Byte id;
    private int num;
    private int year;
    private Set<Request> requests = new HashSet<Request>(0);

    public EntryRegNumbers() {
    }

    public EntryRegNumbers(int num, int year) {
        this.num = num;
        this.year = year;
    }

    public EntryRegNumbers(int num, int year,
            Set<Request> requests) {
        this.num = num;
        this.year = year;
        this.requests = requests;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "RNUM_ID", unique = true, nullable = false)
    public Byte getId() {
        return this.id;
    }

    public void setId(Byte id) {
        this.id = id;
    }

    @Column(name = "RNUM_NUM", nullable = false)
    public int getNum() {
        return this.num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Column(name = "RNUM_YEAR", nullable = false)
    public int getYear() {
        return this.year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "entryRegNumbers")
    public Set<Request> getRequests() {
        return this.requests;
    }

    public void setRequests(Set<Request> requests) {
        this.requests = requests;
    }

}
